public class Test {
    public static void main(String[] args) {
        MyArraylist myArraylist=new MyArraylist();

        myArraylist.add(1);
        myArraylist.add(2);
        myArraylist.add(3);
        myArraylist.add(4);
        myArraylist.add(5);

        myArraylist.display();


        myArraylist.add(0,998);
        myArraylist.add(6,666);
//        myArraylist.add(8,777);//非法性测试

        myArraylist.display();


        System.out.println(myArraylist.contains(998));
        System.out.println(myArraylist.contains(777));

        System.out.println(myArraylist.indexOf(3));
        System.out.println(myArraylist.indexOf(777));


        System.out.println(myArraylist.get(6));
//        System.out.println(myArraylist.get(7));//非法性测试

        myArraylist.set(myArraylist.indexOf(3),777);
        myArraylist.display();


        myArraylist.remove(777);
        myArraylist.display();
        myArraylist.remove(888);


        System.out.println(myArraylist.size());

        myArraylist.clear();
        System.out.println("清空顺序表后：");
        myArraylist.display();
        System.out.println(myArraylist.size());

    }
}
